<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>新增新闻</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="#(ctx)/static/layui/css/layui.css"
	media="all">
</head>
<body>
	<a class="layui-btn layui-btn-radius layui-btn-normal"
		href="javascript:window.history.go(-1);"><i class="layui-icon">&#xe65c;</i>返回</a>
	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 50px;">
		<legend>新闻源</legend>
	</fieldset>

	<form method="POST" class="layui-form" id="myFormId"
		action="#(ctx)/admin/news/batchUpdate" enctype="multipart/form-data">
		<div class="layui-form-item">
			<label class="layui-form-label">新闻源名称</label>
			<div class="layui-input-block">
				<input type="file" id="filePath" name="excel" lay-verify="required" />
			</div>
		</div>
		<div class="layui-form-item">
			<div class="layui-input-block">
				<button class="layui-btn layui-btn-normal" onclick='sub()' id="btn">立即提交</button>
			</div>
		</div>
	</form>
</body>

#@js?("layui")
<script>
	function initComplete() {
		$('#myFormId').live('submit', function() {
			if (valid) {
				$("#btn").attr("disabled", "true");
				$(this).ajaxSubmit({
					success : function(responseText, statusText, xhr, $form) {
						alert(responseText);
					}
				});
			}
			return false;
		});
	}

	function sub() {
		$("#myFormId").submit();
	}
</script>
</html>